# -*- coding: utf-8 -*-

import py_global

# pip install apollo-client
from pyapollo.apollo_client import ApolloClient

import logging

logger = logging.getLogger(__name__)

if __name__ == '__main__':
    app_id = 'apollo-project'
    config_server_url = 'http://localhost:8090'  # 使用adminservice地址
    env = 'DEV'
    apollo_client = ApolloClient(app_id=app_id, config_server_url=config_server_url, env=env)
    namespace = 'application'
    config_key = 'config.key'  # 参数区分大小写
    value = apollo_client.get_value(config_key, 'default', namespace)
    logger.info(f'value:{value}')
    apollo_client.watch()
    pass
